/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.power.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author yyj
* @date 2022-12-06
**/
@Entity
@Data
@Table(name="video")
public class Video implements Serializable {

    @Id
    @Column(name = "id")
    @ApiModelProperty(value = "id")
    private String id;

    @Column(name = "camera_type")
    @ApiModelProperty(value = "摄像头类型")
    private String cameraType;

    @Column(name = "camera_code")
    @ApiModelProperty(value = "摄像头编码")
    private String cameraCode;

    @Column(name = "device_name")
    @ApiModelProperty(value = "设备名称")
    private String deviceName;

    @Column(name = "device_ip")
    @ApiModelProperty(value = "设备IP")
    private String deviceIp;

    @Column(name = "camera_name")
    @ApiModelProperty(value = "摄像头名称")
    private String cameraName;

    @Column(name = "device_code")
    @ApiModelProperty(value = "设备编码")
    private String deviceCode;

    @Column(name = "rtsp_video_stream")
    @ApiModelProperty(value = "RTSP视频流")
    private String rtspVideoStream;

    @Column(name = "interface_ip")
    @ApiModelProperty(value = "接口请求地址")
    private String interfaceIp;

    @Column(name = "video_playing_url")
    @ApiModelProperty(value = "视频播放地址")
    private String videoPlayingUrl;

    @Column(name = "longitude")
    @ApiModelProperty(value = "经度")
    private String longitude;

    @Column(name = "latitude")
    @ApiModelProperty(value = "纬度")
    private String latitude;

    @Column(name = "port")
    @ApiModelProperty(value = "端口号")
    private String port;

    @Column(name = "login_user")
    @ApiModelProperty(value = "登录用户")
    private String loginUser;

    @Column(name = "password")
    @ApiModelProperty(value = "登录密码")
    private String password;

    @Column(name = "map_id")
    @ApiModelProperty(value = "所属图层")
    private String mapId;

    public void copy(Video source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}